package top.up.demo.loadresources.ctrl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import top.up.demo.loadresources.service.LoadResourcesService;

import java.io.IOException;

/**
 * 前端控制器 / Controller 控制层：文件
 *
 * @author <a href="mailto:lishuai2015@163.com">Jack.Li</a>
 * @version 1.0
 * @date 2024/01/13
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/loadResources")
public class LoadResourcesCtrl {

    private final LoadResourcesService loadResourcesService;

    @GetMapping(value = "/test1")
    @ResponseBody
    public String test1() throws IOException {
        log.info("LoadResourcesCtrl.test1");
        this.loadResourcesService.testMethod1("application.yml");
        return "SUCCESS";
    }

    @GetMapping(value = "/test2")
    public String test2() throws IOException {
        log.info("LoadResourcesCtrl.test2");
        this.loadResourcesService.testMethod2("application.yml");
        return "SUCCESS";
    }

    @GetMapping(value = "/test3")
    public String test3() throws IOException {
        log.info("LoadResourcesCtrl.test3");
        this.loadResourcesService.testMethod3("application.yml");
        return "SUCCESS";
    }

    @GetMapping(value = "/test4")
    public String test4() throws IOException {
        log.info("LoadResourcesCtrl.test4");
        this.loadResourcesService.testMethod4("application.yml");
        return "SUCCESS";
    }

    @GetMapping(value = "/test5")
    public String test5() throws IOException {
        log.info("LoadResourcesCtrl.test5");
        this.loadResourcesService.testMethod5("application.yml");
        return "SUCCESS";
    }

    @GetMapping(value = "/test6")
    public String test6() throws IOException {
        log.info("LoadResourcesCtrl.test6");
        this.loadResourcesService.testMethod6("application.yml");
        return "SUCCESS";
    }

    @GetMapping(value = "/test7")
    public String test7() throws IOException {
        log.info("LoadResourcesCtrl.test7");
        this.loadResourcesService.testMethod7("application.yml");
        return "SUCCESS";
    }

    @GetMapping(value = "/test8")
    public String test8() throws IOException {
        log.info("LoadResourcesCtrl.test8");
        this.loadResourcesService.testMethod8("application.yml");
        return "SUCCESS";
    }

    @GetMapping(value = "/test9")
    public String test9() throws IOException {
        log.info("LoadResourcesCtrl.test9");
        this.loadResourcesService.testMethod9("application.yml");
        return "SUCCESS";
    }

}
